home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / standard / trig.z / trig
Encoding:
Text File  |  2002-10-03  |  9.2 KB  |  171 lines

  1. TRIG(3M)                                               Last changed: 2-2-99
  2.  
  3.  
  4. NNAAMMEE
  5.      ssiinn, ccooss, ttaann, aassiinn, aaccooss, aattaann, aattaann22, ffssiinn, ssiinnff, ffccooss, ccoossff, ffttaann,
  6.      ttaannff, ffaassiinn, aassiinnff, ffaaccooss, aaccoossff, ffaattaann, aattaannff, ffaattaann22, aattaann22ff, ssiinnll,
  7.      ccoossll, ttaannll, aassiinnll, aaccoossll, aattaannll, aattaann22ll - trigonometric functions and
  8.      their inverses
  9.  
  10. SSYYNNOOPPSSIISS
  11.      ##iinncclluuddee <<mmaatthh..hh>>
  12.  
  13.      ddoouubbllee ssiinn((ddoouubbllee _x));;
  14.      ffllooaatt ffssiinn((ffllooaatt _x));;
  15.      ffllooaatt ssiinnff((ffllooaatt _x));;
  16.      lloonngg ddoouubbllee ssiinnll((lloonngg ddoouubbllee _x));;
  17.  
  18.      ddoouubbllee ccooss((ddoouubbllee _x));;
  19.      ffllooaatt ffccooss((ffllooaatt _x));;
  20.      ffllooaatt ccoossff((ffllooaatt _x));;
  21.      lloonngg ddoouubbllee ccoossll((lloonngg ddoouubbllee _x));;
  22.  
  23.      ddoouubbllee ttaann((ddoouubbllee _x));;
  24.      ffllooaatt ffttaann((ffllooaatt _x));;
  25.      ffllooaatt ttaannff((ffllooaatt _x));;
  26.      lloonngg ddoouubbllee ttaannll((lloonngg ddoouubbllee _x));;
  27.  
  28.      ddoouubbllee aassiinn((ddoouubbllee _x));;
  29.      ffllooaatt ffaassiinn((ffllooaatt _x));;
  30.      ffllooaatt aassiinnff((ffllooaatt _x));;
  31.      lloonngg ddoouubbllee aassiinnll((lloonngg ddoouubbllee _x));;
  32.  
  33.      ddoouubbllee aaccooss((ddoouubbllee _x));;
  34.      ffllooaatt ffaaccooss((ffllooaatt _x));;
  35.      ffllooaatt aaccoossff((ffllooaatt _x));;
  36.      lloonngg ddoouubbllee aaccoossll((lloonngg ddoouubbllee _x));;
  37.  
  38.      ddoouubbllee aattaann((ddoouubbllee _x));;
  39.      ffllooaatt ffaattaann((ffllooaatt _x));;
  40.      ffllooaatt aattaannff((ffllooaatt _x));;
  41.      lloonngg ddoouubbllee aattaannll((lloonngg ddoouubbllee _x));;
  42.  
  43.      ddoouubbllee aattaann22((ddoouubbllee _y,, ddoouubbllee _x));;
  44.      ffllooaatt ffaattaann22((ffllooaatt _y,, ffllooaatt _x));;
  45.      ffllooaatt aattaann22ff((ffllooaatt _y,, ffllooaatt _x));;
  46.      lloonngg ddoouubbllee aattaann22ll((lloonngg ddoouubbllee _y lloonngg ddoouubbllee _x));;
  47.  
  48. IIMMPPLLEEMMEENNTTAATTIIOONN
  49.      IRIX systems
  50.  
  51. DDEESSCCRRIIPPTTIIOONN
  52.      The single-precision and long double-precision routines listed above
  53.      are only available in the standard math library, --llmm, and in --llmmxx.
  54.  
  55.      ssiinn, ccooss and ttaann return trigonometric functions of radian arguments _x
  56.      for double data types.  ffssiinn, ffccooss and ffttaann, and their ANSI-named
  57.      counterparts ssiinnff, ccoossff and ttaannff return trigonometric functions of
  58.      radian arguments _x for float data types.  ssiinnll, ccoossll and ttaannll do the
  59.      same for long double data types.
  60.  
  61.      The aassiinn routines return the arc sine in the range -_p_i/2 to _p_i/2.  The
  62.      type of both the return value and the single argument are double for
  63.      aassiinn, float for ffaassiinn and its ANSI-named counterpart aassiinnff, and long
  64.      double for aassiinnll.
  65.  
  66.      The aaccooss routines return the arc cosine in the range 0 to _p_i.  The
  67.      type of both the return value and the single argument are double for
  68.      aaccooss, float for ffaaccooss and its ANSI-named counterpart aaccoossff, and long
  69.      double for aaccoossll.
  70.  
  71.      The aattaann routines return the arc tangent in the range -_p_i/_2 to _p_i/2.
  72.      The type of both the return value and the single argument are double
  73.      for aattaann, float for ffaattaann and its ANSI-named counterpart aattaannff, and
  74.      long double for aattaannll.
  75.  
  76.      The aattaann22 routines return the arctangent of _y/_x in the range -_p_i to _p_i
  77.      using the signs of both arguments to determine the quadrant of the
  78.      return value.  Both the return value and the argument types are double
  79.      for aattaann22, float for ffaattaann22 and its ANSI-named counterpart aattaann22ff, and
  80.      long double for aattaann22ll.
  81.  
  82. NNOOTTEESS
  83.      Functions in the standard math library (lliibbmm..aa) are referred to as
  84.      --llmm; functions in the the BSD math library (lliibbmm4433..aa) are referred to
  85.      as --llmm4433 versions.
  86.  
  87.      The --llmm versions always return the default Quiet NaN and set eerrrrnnoo to
  88.      EDOM when a NaN is used as an argument.  A NaN argument usually causes
  89.      the --llmm4433 versions to return the same argument.  The --llmm4433 versions
  90.      never set eerrrrnnoo.
  91.  
  92.      If ||_x|| >> 11, the --llmm versions of the aassiinn and aaccooss functions set eerrrrnnoo
  93.      to EDOM and return NaN. When the argument is greater than one, the
  94.      return value of the --llmm4433 versions is indeterminate.
  95.  
  96.      The aattaann22 functions  return zero if both arguments are zero.  The --llmm
  97.      versions also set eerrrrnnoo to EDOM.  An exception is the --llmm4433 versions,
  98.      which return the following results:
  99.  
  100.           atan2(0.0, 0.0) = 0.0
  101.           atan2(-0.0, 0.0) = -0.0
  102.           atan2(0.0, -0.0) = pi
  103.  
  104.      This matches the proposed ANSI C9X Standard.
  105.  
  106.       The --llmm versions also set eerrrrnnoorr to EDOM for these arguments.
  107.  
  108.      See mmaatthheerrrr(3M) for a description of error handling for --llmmxx
  109.      functions.
  110.  
  111.      The single precision routines ffssiinn, ffccooss, and ffttaann are accurate to
  112.      within 1 ULP for arguments in the range --22****2222 to 22****2222.  Double
  113.      precision routines ssiinn, ccooss, and ttaann are accurate to within 2 ULP for
  114.      arguments in the range --22****2288 to 22****2288.  Arguments larger than this
  115.      lose precision rapidly, but retain more than 20 bits precision out to
  116.      ++//--22****5500 for the double routines.
  117.  
  118.      Long double operations on this system are only supported in round to
  119.      nearest rounding mode (the default).  The system must be in round to
  120.      nearest rounding mode when calling any of the long double functions,
  121.      or incorrect answers result.
  122.  
  123.      Users concerned with portability to other computer systems should note
  124.      that the long double and float versions of these functions are
  125.      optional according to the ANSI C Programming Language Specification
  126.      ISO/IEC 9899 : 1990 (E).
  127.  
  128.      Long double functions are named to be compliant with the ANSI-C
  129.      standard; however, to be backward compatible, they may still be called
  130.      with the double precision function name prefixed with a qq.
  131.  
  132.      The following are reasons for assigning a value to aattaann22((00,,00)):
  133.  
  134.      * Programs that test arguments to avoid computing aattaann22((00,,00)) must be
  135.        indifferent to its value.  Programs that require it to be invalid
  136.        are vulnerable to diverse reactions to that invalidity on diverse
  137.        computer systems.
  138.  
  139.      * aattaann22 is used mostly to convert from rectangular ((xx,,yy)) to polar
  140.        (_r,_t_h_e_t_a) if coordinates that must satisfy xx = (_r*ccooss _t_h_e_t_a) and yy =
  141.        (_r*ssiinn _t_h_e_t_a).  These equations are satisfied when ((xx==00,,yy==00)) is
  142.        mapped to ((rr==00,,tthheettaa==00)).  In general, conversions to polar
  143.        coordinates should be computed as follows:
  144.  
  145.                r:= hypot(x,y);     . . . := sqrt(x*x+y*y)
  146.            theta:= atan2(y,x)
  147.  
  148.      * The previous formulas do not have to be altered to cope in a
  149.        reasonable way with signed zeros and infinities on machines, such as
  150.        SGI 4D machines, that conform to IEEE 754; the versions of hhyyppoott and
  151.        aattaann22 provided for such a machine are designed to handle all cases.
  152.        That is why aattaann22((++--00,,--00)) == ++--_p_i.
  153.  
  154.        In general, the formulas above are equivalent to these:
  155.  
  156.           r := sqrt(x*x+y*y); if r = 0 then x := copysign(1,x);
  157.           if x > 0   then theta := 2*atan(y/(r+x))
  158.                      else theta := 2*atan((r-x)/y);
  159.  
  160.      This is the case except if _r is infinite; then aattaann22 will yield an
  161.      appropriate multiple of _p_i/4 that would otherwise have to be obtained
  162.      by taking limits.
  163.  
  164. SSEEEE AALLSSOO
  165.      mmaatthh(3M), hhyyppoott(3M), ssqqrrtt(3M), mmaatthheerrrr(3M)
  166.  
  167.      The Fortran version of these routines:
  168.      ssiinn(3F), ccooss(3F), ttaann(3F), aassiinn(3F), aaccooss(3F), aattaann(3F), aattaann22(3F)
  169.  
  170.      This man page is available only online.
  171.